<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
require_once PHPEXCEL_ROOT . "PHPExcel/Shared/trend/bestFitClass.php";
class PHPExcel_Linear_Best_Fit extends PHPExcel_Best_Fit
{
    protected $bestFitType = "linear";
    public function getValueOfYForX($xValue)
    {
        return $this->getIntersect() + $this->getSlope() * $xValue;
    }
    public function getValueOfXForY($yValue)
    {
        return ($yValue - $this->getIntersect()) / $this->getSlope();
    }
    public function getEquation($dp = 0)
    {
        $slope = $this->getSlope($dp);
        $intersect = $this->getIntersect($dp);
        return "Y = " . $intersect . " + " . $slope . " * X";
    }
    private function linearRegression($yValues, $xValues, $const)
    {
        $this->leastSquareFit($yValues, $xValues, $const);
    }
    public function __construct($yValues, $xValues = [], $const = true)
    {
        if(parent::__construct($yValues, $xValues) !== false) {
            $this->linearRegression($yValues, $xValues, $const);
        }
    }
}

?>